package Homework6;
import java.util.Scanner;
public class Homework6_3_TestStudentWithException {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int n = input.nextInt();
        int[] arr = new int[n];
        for(int i=0; i<arr.length; i++)
            arr[i] = input.nextInt();
        try{
            for(int i:arr)
                new StudentWithException(i);
        }
        catch(InvalidAgeException invalidAgeException){
            System.out.println(invalidAgeException);
        }
        System.out.println("Object number of StudentWithException: "+
                StudentWithException.getObjectCount());
    }
}
